target: lib

include $(CPPWEB_INSTALL_HOME)/makeconf

OBJ_PATH 	= obj
LIB_OUTPUT 	= $(LIB_OUTPUT_PATH)/libweb.dbentity$(LIB_EXTNAME)

ALLSRC = $(wildcard src/*.c) $(wildcard src/*.cpp)
ALLOBJ = $(patsubst %.c, $(OBJ_PATH)/%.o, $(filter %.c, $(ALLSRC))) \
		 $(patsubst %.cpp, $(OBJ_PATH)/%.o, $(filter %.cpp, $(ALLSRC)))

$(OBJ_PATH)/%.o:%.c
	$(GCC) $(INCPATH) -c -o $@ $<
	
$(OBJ_PATH)/%.o:%.cpp
	$(CPP) $(INCPATH) -c -o $@ $<

entity:
	$(BIN_OUTPUT_PATH)/dbentity$(BIN_EXTNAME) ../../../etc/config.yml

clean:
	@$(DELETEFILE) $(OBJ_PATH)/src/*

init:
	@$(MKDIR) -p $(OBJ_PATH)/src

lib: init $(ALLOBJ)
	$(ARLIB) $(LIB_OUTPUT) $(ALLOBJ)
